<?php 	

class DataJson
{
	private $data;
	public $path;
	
	public static function readJson($path){
		$this->data=file_get_contents($path);
		$this->data=json_decode($this->data,true);
		return $this->data;
	}

	public static writeJson($data,$path){
		$data=json_encode($data);
		file_put_contents($path, $data);
	}
}
$path='./db/db.json';
$data=DataJson::readJson($path);
DataJson::writeJson($data,$path);




 ?>